# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Simon Zeni <simon@bl4ckb0ne.ca>
pkgname=simdjson
pkgver=3.10.1
pkgrel=0
pkgdesc="Parsing gigabytes of JSON per second"
url="https://simdjson.org"
arch="all"
license="Apache-2.0"
# tests take a very long time to compile and require downloading other JSON parsers
options="!check"
makedepends="cmake samurai"
subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/simdjson/simdjson/archive/v$pkgver/simdjson-$pkgver.tar.gz"

build() {
	cmake -B builddir -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_SHARED_LIBS=ON
	cmake -B builddir-static -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release
	cmake --build builddir
	cmake --build builddir-static
}

package() {
	DESTDIR="$pkgdir" cmake --install builddir
	DESTDIR="$pkgdir" cmake --install builddir-static
}

sha512sums="
b19fde8d81eaff34b83bb41028d7ee3a408ae5bc896277148e96879b1cba1a7cfc4af0064973bcb07e2b56e0955c3a3a581910d7af23d68510374e7f297c3b7c  simdjson-3.10.1.tar.gz
"
